package com.dragon.graduation.proposalReport.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dragon.graduation.proposalReport.controller.dto.ProposalReportSearchDTO;
import com.dragon.graduation.proposalReport.controller.vo.ProposalReportVO;
import com.dragon.graduation.proposalReport.entity.ProposalReportEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 开题报告表 Mapper 接口
 * </p>
 *
 * @author dragon
 * @since 2025-02-28 21:20:54
 */
@Mapper
public interface ProposalReportMapper extends BaseMapper<ProposalReportEntity> {

    Page<ProposalReportVO> selectPages(Page<ProposalReportEntity> entityPage, @Param("searchDTO") ProposalReportSearchDTO searchDTO);

    @Select("select * from db_proposal_report where project_id = #{projectId} and student_id = #{studentId} and status!=2 ORDER BY update_time DESC LIMIT 1")
    ProposalReportEntity selectByProjectIdAndStudentId( @Param("projectId") Integer projectId,@Param("studentId") Integer studentId);
}
